<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>我的话题修改</title>

    <link rel="stylesheet" type="text/css" th:href="@{/layui/css/layui.css}">

    <link rel="stylesheet" type="text/css" th:href="@{/css/mian.css}">
    <link th:href="@{/css/semantic.min.css}" rel="stylesheet">
    <link rel="stylesheet" th:href="@{/editor/css/style.css}" />
    <link rel="stylesheet" th:href="@{/editor/css/editormd.css}" />
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <script type="text/javascript" th:src="@{/layui/layui.js}"></script>
    <script type="text/javascript" th:src="@{/layui/blog.js}"></script>
</head>
<body class="lay-blog">
<!--菜单-->
<ul class="layui-nav layui-bg-blue" lay-filter="">
    <li class="layui-nav-item "><a href="/" style="font-size: 20px">首页</a></li>
    <li class="layui-nav-item">
        <a href="javascript:;" style="font-size: 20px">习题库</a>
        <dl class="layui-nav-child"> <!-- 二级菜单 -->
            <dd>
                <a th:href="@{/item/chapter/overview}">分章节练习</a>
            </dd>
            <dd>
                <a th:href="@{/item/overview}">分题型练习</a>
            </dd>
        </dl>
    </li>
    <li class="layui-nav-item">
        <a href="javascript:;" style="font-size: 20px">课程分类</a>
        <dl class="layui-nav-child"> <!-- 二级菜单 -->
            <dd>
                <a th:href="@{'/course/type_show/'+${coursetype.getId()}}" th:each="coursetype:${coursetypes}" th:text="${coursetype.getCourse_name()}"></a>
            </dd>
            <dd>
                <a th:href="@{/course/type_show/0}" >全部课程</a>
            </dd>
        </dl>
    </li>
    <li class="layui-nav-item layui-this" th:if="${session.loginuser} == null"><a th:href="@{/community/index}" style="font-size: 20px">社区</a></li>
    <li class="layui-nav-item layui-this" th:if="${session.loginuser} != null">
        <a href="javascript:;" style="font-size: 20px">社区</a>
        <dl class="layui-nav-child">
            <dd><a th:href="@{/community/index}">社区首页</a></dd>
            <dd><a th:href="@{/stu/community/commenting}">发布话题</a></dd>
            <dd><a th:href="@{/stu/community/management}">我的话题</a></dd>
            <dd><a th:href="@{/stu/chat_all}" target="_blank">头脑风暴</a></dd>
        </dl>
    </li>
    <li class="layui-nav-item"><a th:href="@{/file/list}" style="font-size: 20px">资料干货</a></li>

    <!--如果没有登录-->
    <li class="layui-nav-item" th:if="${session.loginuser} == null">
        <a th:href="@{/login}" style="font-size: 20px">登录</a>
    </li>
    <li class="layui-nav-item" th:if="${session.loginuser} == null">
        <a th:href="@{/register}" style="font-size: 20px">注册</a>
    </li>
    <!--如果没有登录-->

    <!--如果登录-->
    <li class="layui-nav-item" th:if="${session.loginuser} != null">
        <a href="javascript:;" style="font-size: 20px">我的班级</a>
        <dl class="layui-nav-child"> <!-- 二级菜单 -->
            <dd>
                <a th:href="@{/stu/map/show}">班级签到</a>
            </dd>
            <dd>
                <a th:href="@{/stu/exam/overview}">班级考试</a>
            </dd>
            <dd>
                <a th:href="@{/stu/exam/mydegree/list}">我的考试成绩</a>
            </dd>
        </dl>
    </li>
    <li class="layui-nav-item" th:if="${session.loginuser} != null">
        <a href="javascript:;" style="font-size: 20px">好友管理</a>
        <dl class="layui-nav-child"> <!-- 二级菜单 -->
            <dd>
                <a th:href="@{/stu/friends/list}">好友列表</a>
            </dd>
            <dd>
                <a th:href="@{/stu/friends/search}">搜索好友</a>
            </dd>
        </dl>
    </li>
    <li class="layui-nav-item" th:if="${session.loginuser} != null">
        <img th:src="@{'/show/'+${session.loginuser.getId()}}" class="layui-nav-img">[[${session.loginuser.username}]]
        <dl class="layui-nav-child">
            <dd><a th:href="@{/stu/center}">个人中心</a></dd>
            <dd><a th:href="@{/stu/logout}">退出</a></dd>
        </dl>
    </li>

    <!--如果登录-->
</ul>
<!--菜单-->


<div class="container-wrap">
    <div class="container">
        <div class="contar-wrap">
            <h4 class="item-title">
                <p><i class="layui-icon layui-icon-speaker"></i>公告：<span>各位同学注意文明用语，营造一个良好的社区学习环境</span></p>
            </h4>
            <div class="item">

                <form class="layui-form" method="post" th:action="@{/stu/community/updatesubmit}">
                    <!--                <input type="hidden" name="user_id" th:value="${topic.getUser_id()}">-->
                    <!--                <input type="hidden" name="user_name" th:value="${topic.getUsername()}">-->
                    <!--                <input type="hidden" name="course_id" th:value="${topic.getId()}">-->
                    <input type="hidden" name="id" th:value="${blog.getId()}">
                    <div class="layui-form-item">
                        <input type="text" name="subject" th:value="${blog.getSubject()}" placeholder="请输入话题主题" autocomplete="off"  class="layui-input">
                    </div>
<!--                    <div class="layui-form-item layui-form-text">-->
<!--                        <textarea  class="layui-textarea" name="content" th:text="${blog.getContent()}" style="resize:none" placeholder="话题内容"></textarea>-->
<!--                    </div>-->
                    <div id="layout">
                        <!--                        <header>-->
                        <!--                            <h1>Simple example</h1>-->
                        <!--                        </header>-->
                        <div id="test-editormd">
                            <textarea style="display:none;" name="content" th:text="${blog.getContent()}"></textarea>
                        </div>
                    </div>
                    <button class="ui primary button" type="submit">发布</button>
                </form>
                <!--            <div class="item" th:each="blog:${blogs}">-->
                <!--                <div class="item-box  layer-photos-demo1 layer-photos-demo">-->
                <!--                    <h3><a href="" th:text="${blog.getSubject()}"></a></h3>-->
                <!--                    <h4><a href="" th:text="'发布者:'+${blog.getUsername()}"></a></h4>-->
                <!--                    <h5>发布于：<span th:text="${#dates.format(blog.getCreatetime(),'yyyy年MM月dd日 HH:mm')}"></span></h5>-->
                <!--                    <p th:text="${blog.getContent()}"></p>-->
                <!--                    &lt;!&ndash;                    <img th:src="@{/images/item.png}" alt="">&ndash;&gt;-->
                <!--                </div>-->
                <!--                <div class="comment count">-->
                <!--                    <a href="details.html#comment">评论</a>-->
                <!--                    <a href="javascript:;" class="like">点赞</a>-->
                <!--                </div>-->
                <!--            </div>-->
            </div>
        </div>
    </div>
</div>
<!--底部-->
<div class="footer">
    <p>
        <span>&copy; 2020</span>
        <span><a href="http://120.78.82.248:8080" target="_blank">计算机网络课程资源共享网</a></span>
        <span>王侃</span>
    </p>
    <p><span>长风破浪会有时，直挂云帆济沧海</span></p>
</div>
<!--底部-->

</body>
<script>
    //页面层-自定义

    layer.open({
        type: 1,
        title: false,
        closeBtn: 0,
        shadeClose: true,
        skin: 'yourclass',
        content: '自定义HTML内容'
    });
</script>
<script th:src="@{/editor/js/jquery.min.js}"></script>
<script th:src="@{/editor/js/editormd.min.js}"></script>
<script type="text/javascript">
    var testEditor;

    $(function() {
        testEditor = editormd("test-editormd", {
            width   : "90%",
            height  : 640,
            syncScrolling : "single",
            path    : "/editor/lib/"
        });

        /*
        // or
        testEditor = editormd({
            id      : "test-editormd",
            width   : "90%",
            height  : 640,
            path    : "../lib/"
        });
        */
    });
</script>
</html>